<?php

namespace app\model;

use think\Model;

class Ccp extends Model
{
    public static function getItems($query)
    {
        return self::where('status', 1)
            ->where('isdelete', 0)
            ->paginate(5, false, [
                'query' => $query,
                'type' => 'custom'
            ]);
    }

    public static function getTopThree()
    {
        return self::where('status', 1)
            ->where('isdelete', 0)
            ->order('create_time', 'desc')
            ->limit(3)
            ->select();
    }

    public function getCreateTimeAttr($v)
    {
        return intval($v);
    }
}
